﻿using System.Windows;
using Microsoft.DirectX;

namespace MapEngine
{
    public class Point3d
    {
        public float X ;
        public float Y ;
        public float Z ;

        public Point Position { 
            get { return new Point(X, Z); }
            set { X = (float)value.X; Z = (float)value.Y; } 
        }
        public float Height { 
            get { return Y; }
            set { Y = value; }
        }

        public float Yaw { get { return X; } }
        public float Pitch { get { return Y; } }
        public float Roll { get { return Z; } }

        public Point3d()
        {
            X = 0;
            Y = 0;
            Z = 0;
        }

        public Point3d(Point position, float height)
        {
            X = (float)position.X;
            Z = (float)position.Y;
            Y = height;
        }

        public Point3d(float yaw, float pitch, float roll)
        {
            X = yaw;
            Y = pitch;
            Z = roll;
        }

        public Vector3 To2dMapVector() {
            return new Vector3((float)Position.X, Height, (float)Position.Y);
        }

        public Vector3 To3dMapVector()
        {
            return new Vector3(X, Y, Z);
        }

        public Vector3 ToRotationVector() {
            return new Vector3(X, Y, Z);
        }
    }
}
